<?php
class CmsCountryModel extends Model
{
	protected static $instance;

	public static function GetInstance()
	{
		return self::$instance ? self::$instance : self::$instance = new CmsCountryModel();
	}

    protected function LoadFields()
    {
        parent::LoadFields();
        $this->SetForeignKey('language_id', 'cms_language', 'id');
        $this->SetForeignKey('currency_id', 'cms_currency', 'id');
    }

	public function GetDefault()
	{
		return $this->FindById(AppConfig::GetInstance()->DEFAULT_COUNTRY);
	}
}
?>
